<?php

class Sistema_Form_Parametros extends Zend_Form {

    
    public function init() 
    {
   	    
        $front = Zend_Controller_Front::getInstance();
        $controller = $front->getRequest()->getControllerName();
        $module = $front->getRequest()->getModuleName();
        $url = $front->getBaseUrl().'/'.$module.'/'.$controller;
        
        $id = $front->getRequest()->getParam('id',0);
        if($id > 0){
            $data = new Sistema_Model_DbTable_Parametros();
            $data = $data->fetchRow('PAR_ID ='.$id);
        }
        
        $el = new Zend_Form_Element_Hidden('PAR_ID',array('disableLoadDefaultDecorators' =>true));
        $el->addDecorators(array(array('ViewHelper'),array('Errors')))
            ->addFilter('Int');
        $this->addElement($el);

        $el = new Zend_Form_Element_Text('PAR_TEL');
        $el->setLabel('Telefone');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_EML');
        $el->setLabel('E-mail');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_EMLCNT');
        $el->setLabel('E-mail Contato');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_END');
        $el->setLabel('Endereço');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_FAC');
        $el->setLabel('Facebook');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_TWI');
        $el->setLabel('Twitter');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Text('PAR_INS');
        $el->setLabel('Instragram');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('PAR_FACLKEBOX');
        $el->setLabel('Facebook Like Box');
        $this->addElement($el);
              
        $el = new Zend_Form_Element_Text('PAR_SEOTIT');
        $el->setLabel('Seo Título Site');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('PAR_SEODES');
        $el->setLabel('Seo Description');
        $el->setAttrib('rows', '5');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('PAR_SEOKEY');
        $el->setLabel('Seo Keywords ');
        $el->setAttrib('rows', '5');
        $this->addElement($el);
        
        $el = new Zend_Form_Element_Textarea('PAR_GOOANL');
        $el->setLabel('Google Analitics');
        $el->setAttrib('style', 'height:auto');
        $el->setAttrib('rows', '10');
        $this->addElement($el);
        
        $btn = new Zend_Form_Element_Submit('Salvar',array('disableLoadDefaultDecorators' =>true));
        $btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setLabel('Salvar');
        $btn->setAttrib('id', 'submitbutton');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
        $btn = new Zend_Form_Element_Button('Cancelar',array('disableLoadDefaultDecorators' =>true));
        //$btn->addDecorators(array(array('ViewHelper'),array('Errors')));
        $btn->setDecorators(array(array('Description', array('escape' => false, 'tag' => false))));
        $btn->setDescription('<a href="'.$url.'" class="btn-frm">Voltar</a>');
        $btn->setAttrib('id', 'btncancel');
        $btn->setAttrib('class', 'btn-frm');
        $this->addElement($btn);
        
        
    }

}

